fix(workflows): escape step-graph brackets in workflow info so the step type shows#3690
Merged
mnriem merged 1 commit intoJul 23, 2026
Merged
Conversation
…type shows `workflow info` rendered each step as `→ <id> [<type>]`, but console.print has Rich markup enabled, so `[<type>]` was parsed as a style tag named after the step type (command/gate/prompt/…) and silently swallowed — every step printed as `→ <id> ` with the type gone. Escape the literal bracket with `\[` (and escape id/type via _escape_markup, as the sibling workflow_list does), so Rich renders `[<type>]` literally. Mirrors the in-file `\[disabled]` precedent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Rich markup handling so workflow info displays step types in literal brackets.
Changes:
- Escapes step IDs, types, and literal brackets.
- Adds regression coverage for
[gate]rendering.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/workflows/_commands.py |
Corrects step graph rendering. |
tests/test_workflows.py |
Adds regression test. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
specify workflow info <id>renders each step's line as→ <id> [<type>]— with the step type meant to appear inside literal square brackets. Butconsole.printhas Rich markup enabled, so[<type>]is parsed as an opening style tag named after the step type (command,gate,prompt, …). Those aren't valid Rich styles and there's no closing tag, so Rich silently swallows the whole[<type>]token — every step prints as→ <id>with the type gone.Fix
Escape the literal bracket with
\[so Rich renders[<type>]verbatim, and escape the id/type through_escape_markup(as the siblingworkflow_listalready does for displayed fields). Mirrors the in-file\[disabled]precedent inworkflow_list.Tests
tests/test_workflows.py::TestWorkflowInfoStepGraph::test_step_type_rendered_in_literal_brackets— monkeypatchesWorkflowEngine.load_workflowto return a definition with agatestep and asserts[gate]appears inworkflow infooutput. Fails before the fix (output is→ step-one— the[gate]swallowed).ruffclean.AI-assisted: authored with Claude Code. Reproduced the Rich markup-swallowing behavior and verified fail-before/pass-after.